package com.ts.api.module.api.convert.org.convert;

import com.gitee.apanlh.util.base.Eq;
import com.ts.api.module.api.convert.core.annotation.ApiPlan;
import com.ts.api.module.api.convert.core.annotation.ApiPlanConvertType;
import com.ts.api.module.api.convert.core.context.ApiConvertRegister;
import com.ts.api.module.api.convert.org.handler.ApiOrgPhoneMaskConvertHandler;
import org.springframework.stereotype.Component;


/**
 *  API机构掩码转换器上下文
 *
 *  @author Pan
 */
@Component
public class ApiOrgPhoneMaskConvert extends ApiConvertRegister<ApiOrgPhoneMaskConvertHandler, ApiPlan> {

    public ApiOrgPhoneMaskConvert() {
        super(
            ApiOrgPhoneMaskConvertHandler.class,
            ApiPlan.class,
            (annotation) -> Eq.enums(annotation.type(), ApiPlanConvertType.ORG_PHONE_MASK)
        );
    }

    @Override
    public String extractKey(ApiPlan annotation) {
        return annotation.productId();
    }
}

